﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
using DataAccessClasses;

namespace websoniBO
{
    public class Videos
    {
        iDAC DAC = DACFactory.GetDAC();
        private long _vid = -99;
        private string _video = "";
        private bool _isdeleted = false;
        public long vid
        {
            get
            {
                return _vid;
            }
            set
            {
                _vid = value;
            }
        }
        public string video
        {
            get
            {
                return _video;
            }
            set
            {
                _video= value;
            }
        }
        public bool isdeleted
        {
            get
            {
                return _isdeleted;
            }
            set
            {
                _isdeleted = value;
            }
        }
        public long SaveRecords()
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@vid", vid, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@video",video, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@isdeleted", isdeleted, DbType.Boolean, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam3 };
                return DAC.Save("videos_save", dbparamcall);
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return -99;
        }
        public DataTable GetRecords(long vid, string video, bool isdeleted, string paraandor)
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@vid", vid, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@video", video, DbType.AnsiString, ParameterDirection.Input);                
                DbParameter dbparam3 = DAC.Parameter("@isdeleted", isdeleted, DbType.Boolean, ParameterDirection.Input);
                DbParameter dbparam4 = DAC.Parameter("@paraandor", paraandor, DbType.AnsiString, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam3, dbparam4 };
                DataTable dt1 = DAC.Select("videos_get", dbparamcall);
                return dt1;
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return null;
        }
    }
}
